const TransformPages = require('uni-read-pages')
const {webpack} = new TransformPages()
module.exports = {
	configureWebpack: {
		plugins: [
			new webpack.DefinePlugin({
				ROUTES: webpack.DefinePlugin.runtimeValue(() => {
					const tfPages = new TransformPages({
						includes: ['path', 'name', 'meta']
					});
					return JSON.stringify(tfPages.routes)
				}, true )
			})
		]
	},
    devServer: {
		proxy: {
		  '/api': {
			target:'http://127.0.0.1:9401/api',
			pathRewrite: {
			  '^/api': ''
			}
		  },
		  '/v3': {
			target:'https://restapi.amap.com/v3',
			pathRewrite: {
			  '^/v3': ''
			}
		  },
		},
    }
}